<template>
  <span :style="{color:color}">由爺爺組件直接傳值給孫子組件</span>
</template>

<script lang="ts">
import { defineComponent, ref, inject } from "vue";
export default defineComponent({
  name: "son",
  setup() {
    const color = inject("color")
    return {
        color
    };
  }
});
</script>

<style lang="less" scoped>
</style>
